// 时间显示
var spans = document.querySelectorAll('.time span');
setInterval(function () {
    var date = new Date();
    // console.log(date);
    var year = date.getFullYear();
    // console.log(year);
    // month 0-11 获取的月份时 0 - 11
    var month = date.getMonth() + 1;
    // console.log(month);
    var day = date.getDate();
    // console.log(day);
    var hour = date.getHours();
    // console.log(hour);
    var minute = date.getMinutes();
    // console.log(minute);
    var second = date.getSeconds();
    // console.log(second);
    var millisecond = date.getMilliseconds();
    // console.log(millisecond);

    var timeArr = [];
    timeArr.push(year);
    timeArr.push(month);
    timeArr.push(day);
    timeArr.push(hour);
    timeArr.push(minute);
    timeArr.push(second);

    for (let i = 0; i < spans.length; i++) {
        if (timeArr[i] < 10) {
            spans[i].innerHTML = '0' + timeArr[i];
        } else {
            spans[i].innerHTML = timeArr[i];
        }
    }
}, 1000)
